<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="pojo.User" %>
<%@ page import="utils.db.impl.DeviceFetcher" %>
<%@ page import="utils.db.impl.UserFetcher" %>
<%@ page import="java.util.List" %>
<%@ page import="pojo.Device" %>


<%
User user=(User)session.getAttribute("user");

%>
<script type="text/javascript" src="js/searcher.js"></script>
<%if (session.getAttribute("user") == null) {%>
<h1>Brak dostępu do tej strony!</h1>
<%}else{ 
	int id = user.getId();
%>

<h2>Wyszukiwarka:</h2>
<center>
<input type="hidden" id="userId" name="userId" value='<%=id %>'/>
<table>
		<tr>
		<td><label class="panel" for="login">Czego szukać: </label></td> 
		<td><div class="styled-select2">
				<select name="whatSearch" id="whatSearch">
				<option value="0">Wybierz... </option>
				<option value="USER">Użytkownik </option>
				<option value="DEVICE">Urządzenie</option>
				
				</select>
				</div></td>
		</tr>
		<tr>
		<td><label class="panel" for="login">Szukana fraza: </label></td> <td><input id="searcher" name="searcher" type="text" /></td>
		</tr>
	
		</table> 
		
		<br>
	<input type="submit" id="search" class="styled-button-2" value="Szukaj!"/>
		<br>
		<br>
		<div id="res"></div>
											<%
		if (session.getAttribute("warning") != null) {
	%>
	<span><%= session.getAttribute("warning") %></span> 
	<%
		session.removeAttribute("warning");
		}
	%>
</center>
 <script type="text/javascript">
            $('#search').on('click', function(){new Report( this ).search();});
    </script>
<%} %>

